<include file="public@head" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:cmf_plugin_url('Tcad://AdminIndex/index')}">广告列表</a></li>
			<li><a href="{:cmf_plugin_url('Tcad://AdminIndex/add')}">添加广告</a></li>
		</ul>
		<table class="table table-hover table-bordered margin-top-20">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>广告名</th>
					<th>备注</th>
                    <th>状态</th>
					<th width="160">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<php>
                $user_statuses=array("0"=>"未开启","1"=>"开启");
                </php>
				<foreach name="tcad" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.name}</td>
                    <td>{$vo.remark}</td>
                    <td>{$user_statuses[$vo['status']]}</td>
					<td>
                        <a href="{:cmf_plugin_url('Tcad://AdminIndex/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a> |
                        <empty name="vo.status">
                                <a href="{:cmf_plugin_url('Tcad://AdminIndex/cancelban',array('id'=>$vo['id']))}"
                                   class="js-ajax-dialog-btn"
                                   data-msg="您确定要启用此广告位吗？">开启</a>
                                <else/>
                                <a href="{:cmf_plugin_url('Tcad://AdminIndex/ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn"
                                   data-msg="您确定要关闭此广告位吗？">关闭</a>
                        </empty> |
                        <a href="{:cmf_plugin_url('Tcad://AdminIndex/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
                    </td>
				</tr>
				</foreach>
			</tbody>
		</table>

	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>